#ifndef __STUDY__CLASS__29092013__
#define __STUDY__CLASS__29092013__


#include "processing.h"
#include "ntype.h"
#include "sendsignal_f_study.h"
#include "sendsignal_b_study.h"
#include "neuron.h"

typedef struct _rollback_data_tag
{
  int neuron_id;
  int syn_id;
  double w;

}rollback_data;


class study : public Processing
{
  public:
    virtual ~study();


/**
 * set pointer to the neuronet
 */
//     void setneuronet(neuron *);

/**
 * set neuron count
 */
//     void setneuroncount(ntype::neuroncount_t);

/**
 * add input study signal
 */
     virtual void addinstudysignal(ntype::signal_t *);

/**
 * add output study signal
 */
     virtual void addexpextedsignal(ntype::signal_t *);

/**
 * set forward study signal module
 */
     void setsendsignalfstudy(sendsignal_f_study *);

/**
 * set bacward study signal module
 */
     void setsendsignalbstudy(sendsignal_b_study *);

/**
 * set maximum error value
 */
     void setmaxerror(ntype::error_t);
/**
 * get maximum error value
 */
     ntype::error_t getmaxerror();

/**
 * set maximum study cicle
 */
     void setstudyciclecount(uint32_t);

/**
 * get maximum study cicle
 */
     uint32_t getstudyciclecount();

/**
 * @brief instead of this function max study signal count
 *        can be calculated from addinstudysignal or addexpextedsignal
 * the function: DEPRECATED
 */
     void setsignacountmax(int count_max);
/**
 * start study
 */
 //    virtual void start() = 0;

     virtual void printNeuroNet(ntype::signalid_t signalid);

     virtual ntype::error_t getNeuroNetError() = 0;


  protected:
     study();

  protected:
    ntype::signalarray         study_in_signal;
    ntype::signalarray         study_expeced_signal;
    ntype::error_t             max_study_error;
    uint32_t                   study_cicle_count_max;
    sendsignal_f_study        *psignal_study_forward;
    sendsignal_b_study        *psignal_study_back;
    rollback_data              data4rollback;

    ntype::signalid_t          last_in_sig_id;
    ntype::signalid_t          last_out_sig_id;
    ntype::signalid_t          signal_count_max;


};


#endif /* __STUDY__CLASS__29092013__ */
